﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace iopt.solvency.pillarone.client.desktop.Views
{
    /// <summary>
    /// Logique d'interaction pour ModelExplorer.xaml
    /// </summary>
    public partial class ModelExplorer : UserControl
    {
        public ModelExplorer()
        {
            InitializeComponent();
        }

        private void NewActionMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var mwvm = Application.Current.MainWindow.DataContext as iopt.solvency.pillarone.client.desktop.ViewModels.MainWindowViewModel;

            var vmad = new ViewModels.VMActionDesigner();
            vmad.Caption = "Composant";
            mwvm.Documents.Add(vmad);

            var titem = new TreeViewItem();

            titem.Header = "Composant";

            titem.DataContext = vmad;

            ActionTreeViewItem.Items.Add(titem);
        }
    }
}
